<?php

    class ElementTableView extends Element {
        public function Render( tInteger $curpage ) {
            global $table;
            global $db;
            global $server;
            global $page;

            if ( isset( $server[ 'loginrequired' ] ) ) {
                return Redirect( '?p=login' );
            }

            $location = $db->Name() ."@" . $server[ 'name' ];
            if ( $table->Exists() ) {
                $location .= " > " . $table->Name;
            }

            $page->SetTitle( $location );
            $curpage = $curpage->Get();
            
            Element( 'topbar/view' );

            ?><div class="main"><?php
                if ( $table->Exists() ) {
                    Element( 'table/browse/view', $curpage );
                }
                Element( 'postinfo' );
            ?></div><?php
        }
    }

?>
